package cs342.uwosh.edu.ContactsApp;

public class Contact implements Comparable {
	
	private long ID;
	private String name;
	private String address;
	private String homePhoneNumber;
	private String cellPhoneNumber;
	private String alternatePhoneNumber;
	private String email;
	private String comments;
	private final static String NA = "N/A";

	
	public static void main(String[] args) {
		Contact contact = new Contact(0,"bill", "maple st", "(640)930-2859", Contact.NA,Contact.NA,Contact.NA,Contact.NA);
		System.out.println(contact);
	}
	
	public Contact() {
		setID(-1);
		setName(NA);
		setAddress(NA);
		setHomePhoneNumber(NA);
		setCellPhoneNumber(NA);
		setAlternatePhoneNumber(NA);
		setEmail(NA);
		setComments(NA);
	}
	
	public Contact(long ID, String name, String address, String homePhoneNumber,
			String cellPhoneNumber, String alternatePhoneNumber, String email,
			String comments) {
		setID(ID);
		setName(name);
		setAddress(address);
		setHomePhoneNumber(homePhoneNumber);
		setCellPhoneNumber(cellPhoneNumber);
		setAlternatePhoneNumber(alternatePhoneNumber);
		setEmail(email);
		setComments(comments);
	}

	public long getID() {
		return ID;
	}

	public void setID(long iD) {
		ID = iD;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = (address == null) ? NA : address;
	}

	public String getHomePhoneNumber() {
		return homePhoneNumber;
	}

	public void setHomePhoneNumber(String homePhoneNumber) {
		this.homePhoneNumber = (homePhoneNumber == null) ? NA : homePhoneNumber;
	}

	public String getCellPhoneNumber() {
		return cellPhoneNumber;
	}

	public void setCellPhoneNumber(String cellPhoneNumber) {
		this.cellPhoneNumber = (cellPhoneNumber == null) ? NA : cellPhoneNumber;
	}

	public String getAlternatePhoneNumber() {
		return alternatePhoneNumber;
	}

	public void setAlternatePhoneNumber(String alternatePhoneNumber) {
		this.alternatePhoneNumber = (alternatePhoneNumber == null) ? NA : alternatePhoneNumber;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = (email == null) ? NA : email;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = (comments == null) ? NA : comments;
	}
	public boolean equals(Contact contact) {
		if(this.name.equals(contact.getName()) &&
				this.address.equals(contact.getAddress()) &&
				this.homePhoneNumber.equals(contact.getHomePhoneNumber()) &&
				this.cellPhoneNumber.equals(contact.getCellPhoneNumber()) &&
				this.alternatePhoneNumber.equals(contact.getAlternatePhoneNumber()) &&
				this.email.equals(contact.getEmail())) {
			return true;
		} else {
			return false;
		}
	}
//	public String toString() {
//		return
//				"ID:\t" + ID + "\n" +
//				"NAME:\t" + name + "\n" +
//				"ADDRESS:\t" + address + "\n" +
//				"HOMEPHONE:\t" + homePhoneNumber + "\n" +
//				"CELLPHONE:\t" + cellPhoneNumber + "\n" +
//				"ALTPHONE:\t" + alternatePhoneNumber + "\n" +
//				"EMAIL:\t" + email + "\n" +
//				"COMMENTS:\t" + comments + "\n";
//	}
	
	public String toString() {
		return name + "\n" + cellPhoneNumber;
	}

	public int compareTo(Object contact) {
	// TODO Auto-generated method stub
		return this.name.compareTo(((Contact)contact).name);
	}
}
